﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Data.SQLite;
using Com.Toook.Common;

public partial class nst_RssSites : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!Page.IsPostBack)
        {
            InitRssSites();
        }
    }
    private void InitRssSites()
    {
        string sql = "select SiteId, SiteName, IsValid, Url, NewsCount, ExpiryTime, TimeSpan, ErrorN, haveContent, haveImg, type, xmlSiteId, xmlFileName " +
            " from RssSites";
        SQLiteConnection con = SqliteHelper.GetConnection("SQLiteDatabase");
        SQLiteCommand cmd = new SQLiteCommand(sql, con);
        SQLiteDataReader reader = null;
        try
        {
            con.Open();
            reader = cmd.ExecuteReader();
            GridViewRssSites.DataSource = reader;
            GridViewRssSites.DataBind();
        }
        catch(Exception ex)
        {
            LogHelper.Log.Error(ex);
        }
        finally
        {
            SqliteHelper.CloseDbResource(con, reader);
        }
    }
}
